<?php

namespace app\index\validate;

use think\Validate;

class User extends Validate
{
    protected $rule = [
        'agreement'  =>  'require',
        'captcha' =>  'require|captcha',
        'password' =>  'require',
        'repassword' =>  'require|confirm:password',
        'nickname'=>'require',
        'phone'=>'require|regex:1\d{10}|unique:user'
    ];

     protected $message  =   [
        'agreement.require' => '服务条款必须同意',
        'password.require'     => '密码必须填',
        'repassword.confirm'   => '两次密码不一致',
        'phone.unique'  => '手机已经被注册',
        'nickname'        => '昵称必须填',    
    ];

    protected $scene = [
        'edit'  =>  ['nickname','phone'],
    ];
}
